﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>在页面中画点</title>
    <script type="text/javascript" language="JavaScript">
        function Paint(x,y,color){
            document.write("<img border='0' style='position: absolute; left: "+(x+5)+
                "; top: "+(y+5)+";background-color: "+color+"' width=4 height=4 />");
        }
        
    </script>
</head>
<body>
<input id="Button1" type="button" value="画点" onclick="Paint('50','20','red')" />
</body>
</html>